//CSP2021 Junior Competition2
//Problem 4 fruit
//With code as pen, draw beautiful pictures.
//By cyrxdzj
#include<cstdio>
using namespace std;
int n;
int a[200005];
bool del[200005];
int last;
int del_cnt;
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	while(del_cnt<n)
	{
		last=-1;
		for(int i=1;i<=n;i++)
		{
			if(del[i])
			{
				continue;
			}
			if(a[i]!=last)
			{
				printf("%d ",i);
				del[i]=true;
				del_cnt++;
			}
			last=a[i];
		}
		printf("\n");
	}
	return 0;
}

